 <?php 
	
	include_once("../config/database.php");  
	class PhieuDatBan extends database {
	 	private $msPhieuDat;
	 	private $msBan;
		private $hoTenKhach;
		private $soDtQuan;
		private $gioDen;
		private $ngayDat;
		private $ghiChu;
	
		public function setMsPhieuDat($msPhieuDat){
			$this->msPhieuDat = $msPhieuDat;
        }
        public function getMsPhieuDat(){
			return $this->msPhieuDat;
        }
		public function setMsBan($msBan){ 
            $this->msBan = $msBan;
        }
        public function getMsBan(){
            return $this->msBan;
        }
		public function setHoTenKhach($hoTenKhach){ 
            $this->hoTenKhach = $hoTenKhach;
        }
        public function getHoTenKhach(){
            return $this->hoTenKhach;
        }
		public function setSoDtQuan($soDtQuan){ 
            $this->soDtQuan = $soDtQuan;
        }
        public function getSoDtQuan(){
            return $this->soDtQuan;
        }
		public function setGioDen($gioDen){ 
            $this->gioDen = $gioDen;
        }
        public function getGioDen(){
            return $this->gioDen;
        }
		public function setNgayDat($ngayDat){ 
            $this->ngayDat = $ngayDat;
        }
        public function getNgayDat(){
            return $this->ngayDat;
        }
		public function setGhiChu($ghiChu){ 
            $this->ghiChu = $ghiChu;
        }
        public function getGhiChu(){
            return $this->ghiChu;
        }
		
    	public function add(){  
			$this->setQuery("insert into phieudatban(msPhieuDat,msBan,hoTenKhach,soDTQuan,gioDen,ngayDat,ghiChu ;) values  ( '".$this->getmsPhieuDat()."','".$this->getmsBan()."','".$this->gethoTenKhach()."','".$this->getsoDTQuan()."','".$this->getgioDen()."','".$this->getngayDat()."','".$this->getghiChu()."'") ;
			
			return $this->executeQuery(); 
		}
			  
	 	public function update(){     
			$this->setQuery ("update phieudatban set msPhieuDat='".$this->getmsPhieuDat()."' ,msBan='".$this->getmsBan()."' ,hoTenKhach='".$this->gethoTenKhach()."' ,soDTQuan='".$this->getsoDTQuan()."' ,gioDen='".$this->getgioDen()."' ,ngayDat='".$this->getngayDat()."' ,ghiChu='".$this->getghiChu()."'");
         	return $this->executeQuery();
		}

   		public function delete(){
			$this->setQuery("delete from phieudatban where msPhieuDat ='".$this->getmsPhieuDat()."'"); 
		   	return $this->executeQuery(); 
		}
		public function listOfphieudatban () {
			mysql_query ("set character_set_results='utf8'");  
		 	$result = mysql_query("select * from phieudatban"); 
		 	$data; 
		 	while ($row = mysql_fetch_array ($result)) 
				$data [] = $row;	 
		
		 	return $data; 
		}
	}
	
	?> 
			